using net_work.Common.Request;
using net_work.Common.Result;

namespace net_work.IService.ISystem;

public interface IAuthService
{
    /// <summary>
    /// 登录验证
    /// </summary>
    /// <param name="request">登录请求</param>
    /// <returns>用户信息</returns>
    Task<LoginResult?> Authenticate(LoginRequest request);

    /// <summary>
    /// 验证验证码
    /// </summary>
    /// <param name="captchaId">验证码Id</param>
    /// <param name="captcha">验证码</param>
    /// <returns>是否验证通过</returns>
    Task<bool> ValidateCaptcha(string captchaId, string captcha);
    
    /// <summary>
    /// 刷新 Access Token
    /// </summary>
    /// <param name="refreshToken">refreshToken</param>
    /// <returns>新的 Access Token 和 Refresh Token</returns>
    Task<LoginResult?> RefreshToken(string refreshToken);
    
    /// <summary>
    /// 注销
    /// </summary>
    /// <param name="refreshToken">refreshToken</param>
    /// <returns>状态</returns>
    Task Logout(string refreshToken);
}